package ru.ifmo.rybakov.muclumon.analysis2;

import java.util.Map;

public class FunctionMultiply extends Function {

	private Function f1, f2;
	
	
	public FunctionMultiply(Function f1, Function f2) {
		this.f1 = f1;
		this.f2 = f2;
	}
	
	@Override
	public String toString() {
		return "(" + f1.toString() + "*" + f2.toString() + ")";
	}

	@SuppressWarnings("unchecked")
	public Double getValue(Map input) {
		return f1.getValue(input) * f2.getValue(input);
	}
	
	public Function[] getFunctions() {
		return new Function[] { this };
	}
}
